<!DOCTYPE html>
<!--
　┐ ├┬─┐ ┌──┼┼┐
　│ ││　 ┌──┼┼┐
│╯├─┐ ╭──┴╯			W
└╯│    ┌────┐			Z
　│　├─┐ ├────┤			H
　╰┘└　 └────╯
Copyleft by wzh 2020~2022
允许非商业用途的阅读、使用、复制、分发代码，
修改借鉴代码和派生作品请告知作者，
欢迎为代码的完善和新的功能提出建议或想法。
-->
<html lang="zh">
	<head>
		<meta charset="UTF-8" />
		<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport" />
		<title>我的世界</title>
		
		<!--icon-->
		<link href="https://pic.imgdb.cn/item/6301e20f16f2c2beb152e797.png" rel="icon" type="image/x-icon"/>
		
		<!-- 异步fonts加载 -->
		<script src="https://cdn.jsdelivr.net/gh/wzh656/MinecraftWeb@master/old/js/modules/webfontloader.js"></script>
		<script>
		if (typeof require != "undefined"){ //electron
			console.log("electron")
			document.write(`<link href="./css/fonts.css" rel="stylesheet" type="text/css" />`);
			window.onload = function(){
				console.log("onload")
				$("body").addClass("wf-active");
			};
		}else{
			WebFont.load({
				google: {
					families: ["kt", "st", "xs", "zyyt"],
					api: "https://cdn.jsdelivr.net/gh/wzh656/MinecraftWeb@master/old/css/fonts.css"
				}
			});
		}
		</script>

		
		<link href="https://cdn.jsdelivr.net/gh/wzh656/MinecraftWeb@master/old/css/bootstrap.css" rel="stylesheet" type="text/css" />
		<style>
		/* 字体缩放方案 */
		@media screen and (max-width:320px){
			body {font-size: calc(0.018 * 320px + 5px);}
		}
		body{
			font-size: calc(1.8vw + 5px);
		}
		@media screen and (min-width: 960px){
			body {font-size: calc(0.018 * 960px + 5px);}
		}
		
		/* element */
		html{
			-moz-user-select: none;
			-khtml-user-select: none;
			user-select: none;
			
			/* 背景 */
			min-height: 100%;
			background: #1b2036 url("https://pic.imgdb.cn/item/6301e1b616f2c2beb152bbab.jpg") no-repeat fixed center;
			background-size: cover;
			max-width: 100%;
			margin: auto;
		}
		body{
			position: absolute;
			width: 100%;
			height: 100%;
			margin: 0;
			overflow: hidden;
		}
		small{
			display: block;
			font-size: 0.36em;
			margin: 0;
		}
		button,label,summary{
			cursor: pointer;
		}
		dialog{
			border-radius: 1vw;
			
			top: 50%;
			transform: translateY(-50%);
		}
		
		
		/*INIT*/
		.init{
			position: absolute;
			width: 100%;
			height: 100%;
			margin: 0;
			text-align: center;
			
			display: flex;
			flex-direction: column;
			justify-content: space-around;
		}
		.init h1{
			color: white;
			font-size: 4.6em;
			margin: 0;
		}
		.init button{
			font-size: 2.6em;
			margin: 0 auto;
			padding: 1vmax;
		}
		.init > div{
			display: flex;
			flex-direction: column;
			justify-content: space-around;
			margin: 0 auto;
		}
		.init > div > button{
			width: calc(66vw + 3vmax * 2);
		}
		.init > div > div{
			display: flex;
			justify-content: space-around;
		}
		.init > div > div > button{
			width: 33vw;
			margin: 3vmax;
		}
		
		
		/* NEW WORLD */
		.new_world{
			position: absolute;
			width: 100%;
			height: 100%;
			top: 100%;
			left: 0;
			margin: 0;
			font-size: 1em;
			background-color: white;
			opacity: 0;
			overflow-y: auto;
		}
		.new_world h2{
			font-size: 3.6em;
			text-align: center;
		}
		.new_world label{
			font-size: 1.6em;
		}
		.new_world input{
			width: 66%;
			font-size: 1.6em;
			
			border: 1px solid #ced4da;
			border-radius: 0.3em;
			padding: 0.2vmax;
			line-height: 1.5;
			color: #495057;
			background-color: #fff;
			background-clip: padding-box;
		}
		.new_world button{
			width: 46vw;
			/*height: 6.8%;*/
			margin: 3px;
			font-size: 2em;
		}
		
		
		/* MORE */
		.more{
			margin: 3px;
			
			/* display: flex;
			flex-direction: column;
			justify-content: space-around;
			flex-wrap: wrap; */
		}
		.more[open]{
			/*border: 1px solid black;*/
			padding-left: 1vw;
			/*border-radius: 3px;*/
			/* clear:both; */
		}
		.more > summary{
			font-size: 2em;
			margin-left: 1%;
			outline: none;
		}
		.more > fieldset{
			display: inline-block;
			float: left;
			width: 80vw;
			margin: 3vw;
		}
		/* 横屏情况下 */
		@media screen and (orientation:landscape){
			.more > fieldset{
				width: 42vw;
				margin: 1vh 0;
			}
		}
		.more > fieldset > legend{
			font-size: 1.8em;
			margin: 0;
		}
		.more > fieldset > fieldset > legend{
			font-size: 1.6em;
			margin: 0;
		}
		.more input:not([type="range"]){
			width: 6vw;
			font-size: 1em;
		}
		.more input[type="range"]{
			width: 16vw;
		}
		/* .more > div[class]{
			float: left;
			padding-top: 2vh;
			border: 1vmax solid black;
			border-radius: 1vmax;
		}
		.more div{
			padding-left: 2vw;
		} */
		
		
		/* ABOUT */
		.about{
			position: absolute;
			width: 100%;
			height: 100%;
			top: 100%;
			left: 0;
			font-size: 1em;
			margin: 0;
			background-color: white;
			opacity: 0;
			overflow-y: auto;
		}
		.about h2{
			font-size: 3.6em;
			text-align: center;
		}
		.about button{
			width: 66vw;
			font-size: 2em;
			margin: 1vmax;
		}
		.about > div{
			padding: 2vmax;
			margin: 3vmax;
		}
		
		
		/* COMMUNITY*/
		.community{
			position: absolute;
			width: 100%;
			height: 100%;
			top: 100%;
			left: 0;
			margin: 0;
			background-color: white;
			opacity: 0;
		}
		.community h1{
			margin-top: 10vh;
			font-size: 3em;
			text-align: center;
		}
		
		/* noscript */
		noscript{
			position: absolute;
			top: 0;
			left: 0;
			width: 100%;
			height: 100%;
			background-color: #fffae8;
			text-align: center;
		}
		</style>
		
		<!-- jquery -->
		<script src="https://cdn.jsdelivr.net/gh/wzh656/MinecraftWeb@master/old/js/modules/jquery.min.js"></script>
		<script>
		if (typeof require != "undefined") //electron
			window.$ = window.jQuery = require("./js/modules/jquery.min.js");
		</script>
		
		<!-- layui -->
		<!--<link rel="stylesheet" href="https://unpkg.com/layui@2.6.4/dist/css/layui.css">-->
		<script src="https://unpkg.com/layui@2.6.8/dist/layui.js"></script>
		<!--<script src="https://cdn.jsdelivr.net/gh/wzh656/MinecraftWeb@master/old/js/modules/layui.js"></script>-->

		<!-- 调试工具 -->
		<!--<script src="https://cdn.jsdelivr.net/npm/eruda"></script>
		<script src="https://cdn.bootcss.com/vConsole/3.3.4/vconsole.min.js"></script>
		<script>
		if ( /ipad|iphone|midp|rv:1.2.3.4|ucweb|android|windows ce|windows mobile/.test( navigator.userAgent.toLowerCase() ) ){
			//手机
			eruda.init();
			new VConsole();
		}
		</script>-->
		
		<!-- DaoVoice -->
		<script async defer>
		daovoice('init', {
			app_id: "cfb04fc0"
	 	});
		daovoice('update');
		</script>
		
		<!-- gitter -->
		<script defer>
		((window.gitter = {}).chat = {}).options = {
			room: 'wzh656/Minecraft'
		};
		</script>
		<script src="https://sidecar.gitter.im/dist/sidecar.v1.js" async defer></script>
		
		<!-- 流量统计 -->
		<script src="https://wzh656.github.io/MinecraftWeb/js/modules/count.js" async></script>
		<script>
		var _hmt = _hmt || [];
		(function() {
			var hm = document.createElement("script");
			hm.src = "https://hm.baidu.com/hm.js?c6b8f0ad7ec671e54d83e86a67280999";
			var s = document.getElementsByTagName("script")[0]; 
			s.parentNode.insertBefore(hm, s);
		})();
		</script>
		
		<!-- Google tag (gtag.js) -->
		<script async src="https://www.googletagmanager.com/gtag/js?id=G-FFD7GVHXJB"></script>
		<script>
		window.dataLayer = window.dataLayer || [];
		function gtag(){dataLayer.push(arguments);}
		gtag('js', new Date());
			
		gtag('config', 'G-FFD7GVHXJB');
		</script>
		
		<script src="https://cdn.jsdelivr.net/gh/wzh656/MinecraftWeb@master/old/js/modules/js_plus.min.js"></script> <!-- js+ -->
    	<script src="https://wzh656.github.io/MinecraftWeb/js/modules/dynamic.js" async></script> <!-- dynamic -->
		
	</head>
	<body>
		<!-- 初始页 -->
		<section class="init" style="display: flex;">
			<h1>我的世界</h1>
			<div>
				<button class="success" id="new_world" >新的世界<small>New World</small></button>
				<div>
					<button class="info" id="about">关于<small>About</small></button>
				</div>
			</div>
		</section>
		
		<!-- 新的世界 -->
		<section class="new_world" style="display: none;">
			<h2>新的世界<small>NEW WORLD</small></h2>
			<label for="seed">种子(seed)：</label><input name="seed" id="seed" placeholder="不输入则随机生成" autofocus />
			<br/>
			<details class="more">
				<summary>高级设置</summary>
				<fieldset class="time-position">
					<legend>时空(time&position)</legend>
					游戏开始时间：<input type="datetime-local" name="time" style="width: 36vw;" /><br/><br/>
					<hr/>
					坐标原点纬度：<br/>
					-90°(S)<input type="range" min="-90" max="90" value="40" step="0.00001" name="latitude" />90°(N)
					<input type="number" min="-90" max="90" step="0.00001" value="40" style="width: 16vw;" />°<br/>
					<br/>
					坐标原点经度：<br/>
					-180°(E)<input type="range" min="-180" max="180" value="116" step="0.00001" name="longitude" />180°(S)
					<input type="number" min="-180" max="180" step="0.00001" value="116" style="width: 16vw;" />°<br/>
					<button class="success" style="width: 96%; font-size: 2vmax;">重新获取地理位置<small>注意：请先打开GPS开关</small></button>
				</fieldset>
				<fieldset class="height">
					<legend>高度(height)</legend>
					最小/m：1m<input type="range" min="1" max="256" step="0.1" value="1" name="min" />256m <input type="number" min="1" max="256" step="0.1" value="1" value="1" />m<br/>
					最大/m：1m<input type="range" min="1" max="256" step="0.1" value="256" name="max" />256m <input type="number" min="1" max="256" step="0.1" value="256"/>m<br/>
					平滑程度：1<input type="range" min="1" max="1000" step="1" value="166" name="q" />1000 <input type="number" min="1" max="1000" step="1" value="166"/>
					<fieldset class="error">
						<legend>误差(error)</legend>
						最小/m：-5m<input type="range" min="-5" max="5" step="0.1" value="-1" name="min" />5m <input type="number" min="-5" max="5" step="0.1" value="-1"/>m<br/>
						最大/m：-5m<input type="range" min="-5" max="5" step="0.1" value="1" name="max" />5m <input type="number" min="-5" max="5" step="0.1" value="1"/>m<br/>
						平滑程度：1<input type="range" min="1" max="100" step="1" value="36" name="q" />100 <input type="number" min="1" max="100" step="1" value="36"/>
					</fieldset>
				</fieldset>
				<fieldset class="dirt">
					<legend>泥土层百分比(dirt)</legend>
					最小：0<input type="range" min="0" max="1" step="0.01" value="0.1" name="min" />1 <input type="number" min="0" max="1" step="0.01" value="0.1"/><br/>
					最大：0<input type="range" min="0" max="1" step="0.01" value="0.4" name="max" />1 <input type="number" min="0" max="1" step="0.01" value="0.4"/><br/>
					平滑程度：1<input type="range" min="1" max="1000" step="1" value="66" name="q" />1000 <input type="number" min="1" max="1000" step="1" value="66"/>
					<fieldset class="error">
						<legend>误差(error)</legend>
						最小：-0.5<input type="range" min="-0.5" max="0.5" step="0.01" value="-0.1" name="min" />0.5 <input type="number" min="-0.5" max="0.5" step="0.01" value="-0.1"/><br/>
						最大：-0.5<input type="range" min="-0.5" max="0.5" step="0.01" value="0.1" name="max" />0.5 <input type="number" min="-0.5" max="0.5" step="0.01" value="0.1"/><br/>
						平滑程度：1<input type="range" min="1" max="100" step="1" value="6" name="q" />100 <input type="number" min="1" max="100" step="1" value="6"/>
					</fieldset>
				</fieldset>
				<fieldset class="openStone">
					<legend>允许石头露天出现（负值不允许）(openStone)</legend>
					最小：-5<input type="range" min="-5" max="5" step="0.01" value="-0.99" name="min" />5 <input type="number" min="-5" max="5" step="0.01"  value="-0.99"/><br/>
					最大：-5<input type="range" min="-5" max="5" step="0.01" value="0.01" name="max" />5 <input type="number" min="-5" max="5" step="0.01"  value="0.01"/><br/>
					平滑程度：1<input type="range" min="1" max="1000" step="1" value="1" name="q" />1000 <input type="number" min="1" max="1000" step="1" value="1"/>
				</fieldset>
				<fieldset class="type">
					<legend>区块类型(type)</legend>
					生成森林(forest)的概率：0<input type="range" min="0" max="1" step="0.01" value="0.4" name="forest" />1 <input name="forest" min="0" max="1" step="0.01" value="0.4"/><br/>
					生成草原(grassland)的概率：0<input type="range" min="0" max="1" step="0.01" value="0.4" name="grassland" />1 <input name="grassland" min="0" max="1" step="0.01" value="0.4"/><br/>
					生成沙漠(desert)的概率：0<input type="range" min="0" max="1" step="0.01" value="0.2" name="desert" />1 <input name="desert" min="0" max="1" step="0.01" value="0.2"/><br/>
					平滑程度：1<input type="range" min="1" max="1000" step="1" value="666" name="q" />1000 <input type="number" min="1" max="1000" step="1" value="666"/>
				</fieldset>
				<fieldset class="treeHeight">
					<legend>树高(treeHeight)</legend>
					<fieldset class="plant">
						<legend>允许生成树(plant)</legend>
						最小：-1<input type="range" min="-1" max="1" step="0.001" value="0.5" name="min" />1 <input type="number" min="-1" max="1" step="0.001" value="0.5"/><br/>
						最大：-1<input type="range" min="-1" max="1" step="0.001" value="0.667" name="max" />1 <input type="number" min="-1" max="1" step="0.001" value="0.667"/><br/>
					</fieldset>
					最小：1<input type="range" min="1" max="30" step="0.1" value="1" name="min" />10 <input type="number" min="1" max="30" step="0.1" value="1"/><br/>
					最大：1<input type="range" min="1" max="30" step="0.1" value="10" name="max" />10 <input type="number" min="1" max="30" step="0.1" value="10"/><br/>
					平滑程度：1<input type="range" min="1" max="100" step="1" value="1" name="q" />100 <input type="number" min="1" max="100" step="1" value="1"/>
					<fieldset class="error">
						<legend>误差(error)</legend>
						最小：-5<input type="range" min="-5" max="5" step="0.1" value="-1" name="min" />5 <input type="number" min="-5" max="5" step="0.1" value="-1"/><br/>
						最大：-5<input type="range" min="-5" max="5" step="0.1" value="1" name="max" />5 <input type="number" min="-5" max="5" step="0.1" value="1"/><br/>
						平滑程度：1<input type="range" min="1" max="100" step="1" value="1" name="q" />100 <input type="number" min="1" max="100" step="1" value="1"/>
					</fieldset>
				</fieldset>
				<fieldset class="leavesScale">
					<legend>树叶高度与树高之比(leavesScale)</legend>
					最小：0.01<input type="range" min="0.01" max="0.99" step="0.01" value="0.6" name="min" />0.99 <input type="number" min="0.01" max="0.99" step="0.01" value="0.6"/><br/>
					最大：0.01<input type="range" min="0.01" max="0.99" step="0.01" value="0.86" name="max" />0.99 <input type="number" min="0.01" max="0.99" step="0.01" value="0.86"/><br/>
					平滑程度：1<input type="range" min="1" max="100" step="1" value="16" name="q" />100 <input type="number" min="1" max="100" step="1" value="16"/>
					<fieldset class="error">
						<legend>误差(error)</legend>
						最小：-0.5<input type="range" min="-0.5" max="0.5" step="0.01" value="-0.1" name="min" />0.5 <input type="number" min="-0.5" max="0.5" step="0.01" value="-0.1"/><br/>
						最大：-0.5<input type="range" min="-0.5" max="0.5" step="0.01" value="0.1" name="max" />0.5 <input type="number" min="-0.5" max="0.5" step="0.01" value="0.1"/><br/>
						平滑程度：1<input type="range" min="1" max="100" step="1" value="6" name="q" />100 <input type="number" min="1" max="100" step="1" value="6"/>
					</fieldset>
				</fieldset>
				<fieldset class="weatherRain">
					<legend>降雨概率（负值不下雨）(weatherRain)</legend>
					最小：-1<input type="range" min="-1" max="1" step="0.01" value="-0.6" name="min" />1 <input type="number"min="-1" max="1" step="0.01"  value="-0.6"/><br/>
					最大：-1<input type="range" min="-1" max="1" step="0.01" value="0.3" name="max" />1 <input type="number"min="-1" max="1" step="0.01"  value="0.3"/><br/>
					平滑程度：1<input type="range" min="1" max="100" step="1" value="16" name="q" />100 <input type="number" min="1" max="100" step="1" value="16"/>
					<fieldset class="error">
						<legend>误差(error)</legend>
						最小：-0.5<input type="range" min="-0.5" max="0.5" step="0.01" value="-0.1" name="min" />0.5 <input type="number" min="-0.5" max="0.5" step="0.01" value="-0.1"/><br/>
						最大：-0.5<input type="range" min="-0.5" max="0.5" step="0.01" value="0.1" name="max" />0.5 <input type="number" min="-0.5" max="0.5" step="0.01" value="0.1"/><br/>
						平滑程度：1<input type="range" min="1" max="100" step="1" value="6" name="q" />100 <input type="number"min="1" max="100" step="1"  value="6"/>
					</fieldset>
				</fieldset>
				<div style="clear:both;">
					<button onclick="reset();" class="danger" style="clear:both;">重置</button>
				</div>
				<br style="clear:both;" />
			</details>
			<button class="warn back">取消<small>Cancel</small></button>
			<button class="success">生成世界<small>OK</small></button>
		</section>
		
		<!-- 关于 -->
		<section class="about" style="display: none;">
			<h2>关于<small>ABOUT</small></h2>
			<div>
				<h3>回首往事</h3>
				<hr/>
				<font style="font-family: st;">衣带渐宽终不悔，为伊消得人憔悴</font><br/>
				我用自己的业余时间打造了这个项目，已有一年的风雨坎坷，虽然它也许很简陋且有很多bug，但它仍在不断前行，我相信它将来一定会变得越来越好。
			</div>
			<div>
				<h3>2022/05/29更</h3>
				<hr/>
				<p>承蒙各位光临拙作，该项目为本人2020年网课时摸鱼所作，至今年代久远，学业繁忙，年久失修，敬请谅解。</p>
				<p>下面统一答复大家遇到的一些问题：</p>
				<ul>
					<li><strong>网页加载慢、打不开、点“生成”无反应</strong>：若访问的是网页版，因<i>Github</i>为外国网站，网速较慢，而项目加载资源较多，可能消耗较多流量，故初次加载请保持网络流畅，并耐心等待。<strong>推荐Android/Windows平台下载apk/exe文件运行</strong></li>
					<li><strong>卡在生成世界，加载进度始终为零</strong>：旧版可能遇到此bug，由打开数据库出错导致，刷新网页或重启程序即可进入
					</li>
				</ul>
				<p>如有其他问题，欢迎提出</p><p>附：</p><p>项目官网地址：<a href=https://wzh656.github.io/MinecraftWeb/index.html>https://wzh656.github.io/MinecraftWeb/index.html</a></p><p>Android/Windows平台apk/exe全版本蓝奏<strong>下载链接</strong>：<a href=https://wwm.lanzouj.com/b02j8yogj>https://wwm.lanzouj.com/b02j8yogj</a>（密码：wzh）</p>
			</div>
			<div>
				<h3>2022/06/08更</h3>
				<hr/>
				<p>目前交流区已加入在线人数显示功能。</p>
				<p>游戏中部分特色功能（更多介绍请参见官网<a href=https://wzh656.github.io/MinecraftWeb/index.html>https://wzh656.github.io/MinecraftWeb/index.html</a>）：</p>
				<ol class="task-list">
					<li><input type="checkbox" disabled="disabled" checked>通过 <i>F=ma</i>, <i>v=at</i>, <i>s=vt</i> 等经典物理公式计算玩家运动加速度、速度及位移</li>
					<li><input type="checkbox" disabled="disabled" checked>考虑空气阻力 <i>f = 1/2*CρSV²</i> 对玩家的影响</li>
					<li><input type="checkbox" disabled="disabled" checked>考虑宇宙无规则随机扰动产生的蝴蝶效应对一切参数数据的影响</li>
					<li><input type="checkbox" disabled="disabled" checked>【特性】<i>XYZ</i>轴均无限、区块无限的世界</li>
					<li><input type="checkbox" disabled="disabled" checked>【特性】爬树功能</li>
					<li><input type="checkbox" disabled="disabled" checked>根据玩家设置的<i>经纬度</i>和<i>开始日期时间</i>计算日出日落时间和天空颜色、环境光颜色</li>
					<li><input type="checkbox" disabled="disabled" checked>具有降雨量控制天气系统</li>
					<li><input type="checkbox" disabled="disabled" checked>根据种子(<i>seed</i>)用柏林噪声(<i>simplexNoise</i>)随机生成的具有区块类型、地形、土壤层厚度、树高、树叶高、降雨量等完善属性的区块系统</li>
					<li><input type="checkbox" disabled="disabled" checked="">独立于现实且可更改流速、可进行<i>setTimeout</i>, <i>setInterval</i>, <i>clearTimeout</i>, <i>clearInterval</i>的时间系统</li>
				</ol>
				<p>同开发者其他项目推荐：</p>
				<ul>
					<li>4D五子棋：
						<ul>
							<li>直接游玩：<a href="https://gobang-4d.vercel.app/">https://gobang-4d.vercel.app/</a></li>
							<li>Github版（网速较慢）：<a href="https://wzh656.github.io/gobang">https://wzh656.github.io/gobang/</a></li>
							<li>TapTap链接：<a href="https://www.taptap.com/app/222701">https://www.taptap.com/app/222701</a></li>
							<li>国内派生网站（版本较旧）：<a href="http://wzq.fuengby.top/">http://wzq.fuengby.top/</a></li>
							<li>蓝奏云下载链接：<a href="https://wwm.lanzouj.com/b02ibn2yb">https://wwm.lanzouj.com/b02ibn2yb</a>（密码wzh）</li>
						</ul>
					</li>
				</ul>
			</div>
			<div>
				<h3>联系作者</h3>
				<hr/>
				开发者：@wzh656<br/>
				<a class="newTable" href="https://github.com/wzh656/">Github</a><br/>
				<a class="newTable" href="https://gitee.com/wzh656/">Gitee</a><br/>
				<!-- 作者注：clone项目请保留以上作者和github/gitee链接 --><br/>
				<a href="https://support.qq.com/product/425928" onclick="if (typeof plus != 'undefined') plus.screen.lockOrientation('portrait-primary');">反馈中心</a><br/>
				<a href="http://chat.daovoice.io?id=cfb04fc0" onclick="if (typeof plus != 'undefined') plus.screen.lockOrientation('portrait-primary');">在线联系作者</a><br/>
				<a class="newTable" href="https://gitter.im/wzh656/Minecraft?utm_source=badge&amp;utm_medium=badge&amp;utm_campaign=pr-badge&amp;utm_content=badge">Gitter<img src="https://badges.gitter.im/wzh656/Minecraft.svg" alt="Join the chat at https://gitter.im/wzh656/Minecraft" /></a><br/>
				邮箱：<a href="mailto:1826632591@qq.com?subject=关于《我的世界（仿）》">1826632591@qq.com</a><br/>
				QQ：1826632591<a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=1826632591&site=qq&menu=yes"><img border="0" src="http://wpa.qq.com/pa?p=2:1826632591:51" alt="点击这里给我发消息" title="点击这里给我发消息"/></a>
			</div>
			<hr/>
			<center><button class="warn back">返回<small>Back</small></button></center>
		</section>
		
		<!-- 1:不支持js -->
		<noscript style="z-index: 1;"><h1>你的浏览器不支持JavaScript，无法运行！</h1></noscript>
		
		<footer style="display: none;">
			<script type="text/javascript">document.write(unescape("%3Cspan id='cnzz_stat_icon_1280239030'%3E%3C/span%3E%3Cscript src='https://v1.cnzz.com/z_stat.php%3Fid%3D1280239030%26online%3D1%26show%3Dline' type='text/javascript'%3E%3C/script%3E"));</script>
		</footer>
		
<script>
//input处理
for (const i of $(".more input"))
	i["data-init"] = i.value;

//重置
function reset(){
	for (const i of $(".more input"))
		i.value = i["data-init"];
}

//range <==> number
$(".more input[type='range']").change(function(){
	$(this).next().val(this.value);
});
$(".more input[type='number']").change(function(){
	if (isNaN(this.value))
		this.value = this["data-init"];
	$(this).prev().val( Number(this.value) );
	this.value=$(this).prev().val();
});

//time
function dateToInputValue(date){
	if (typeof date == "number") date = new Date(date);
	return (
			date.getFullYear() + "-"+
			String( date.getMonth()+1 ).padStart(2, "0") + "-"+
			String( date.getDate() ).padStart(2,"0") + "T"+
			String( date.getHours() ).padStart(2,"0") + ":"+
			String( date.getMinutes() ).padStart(2,"0")
		);
}
function inputValueToDate(date){
	const [, year, mouth, day, hour, minute] = /(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})/.exec(date);
	return new Date(year, mouth-1, day, hour, minute);
}
$(".more > .time-position > input[name='time']")
	.val( new Date(new Date().setFullYear(3000)).format("yyyy-MM-ddThh:mm") )
	.change(function(){
		if (!this.value)
			this.value = new Date(new Date().setFullYear(3000)).format("yyyy-MM-ddThh:mm");
	});

//position
function getGeolocationPosition(){
	return new Promise((resolve, reject)=>{
		const successCallback = (latitude, longitude)=>{
				console.log(latitude, longitude)
				$(".more > .time-position > input[name='latitude']").val( latitude ).next().val( latitude );
				$(".more > .time-position > input[name='longitude']").val( longitude ).next().val( longitude );
				resolve(["获取成功！", {latitude, longitude}])
			},
			errCallback = (err)=>{
				switch (err.code){
					case 1:
						reject(["地理位置服务被拒绝", err]);
						break;
					case 2:
						reject(["暂时获取不到地理位置信息", err]);
						break;
					case 3:
						reject(["获取地理位置信息超时", err]);
						break;
					default:
						reject(["未知错误", err]);
						break;
				}
			};
		if ( navigator.userAgent.toLowerCase().indexOf("html5plus") != -1 ){ //html5+
			const plusGetPosition = function(){
				plus.geolocation.getCurrentPosition(function(position){
					console.log("plus", position);
					successCallback(position.coords.latitude, position.coords.longitude);
				}, errCallback);
			};
			if (typeof plus == "undefined"){ //未加载完毕
				console.log("html5+ hasn't ready")
				document.addEventListener("plusready", plusGetPosition);
			}else{ //手机版plus
				console.log("html5+ ready")
				plusGetPosition();
			}
		}else{ //网页版
			console.log("api")
			$.get("https://api.vvhan.com/api/getIpInfo",function(data, status, xhr){ //API
				if (status == "success" && data.info && data.info.lat && data.info.lng){
					console.log("api success", data)
					successCallback(data.info.lat, data.info.lng);
				}else{ //退用navigator
					console.log("api fail")
					if (navigator.geolocation){ //支持获取地理位置
						console.log("navigator")
						navigator.geolocation.getCurrentPosition(function(position){
							console.log("navigator", position);
							successCallback(position.coords.latitude, position.coords.longitude);
						}, errCallback);
					}else{ //不支持获取地理位置
						reject(["不支持获取地理位置", navigator.geolocation])
					}
				}
			});
		}
	});
}
$(".more > .time-position > button").click(async function(){
	let res = [];
	try{
		res = await getGeolocationPosition();
		if (res && res[0]){
			$(".more > .time-position > button > p").html( res[0] );
		}
	}catch(err){
		if (res && res[0]){
			console.error( res[1] );
			$(".more > .time-position > button > p").html( res[0] )
		}
	}
});

//type
$(`.more > .type > input[name='forest'],
.more > .type > input[name='grassland'],
.more > .type > input[name='desert']`).on("change", function(){
	for (let i=0; i<100; i++){
		let sum = +( $(".more > .type > input[name='forest'][type='range']").val() )+
			+( $(".more > .type > input[name='grassland'][type='range']").val() )+
			+( $(".more > .type > input[name='desert'][type='range']").val() );
		sum = Math.round(sum*10e5)/10e5;
		$(".more > .type > input[name='forest']").val( $(".more > .type > input[name='forest'][type='range']").val()/sum );
		$(".more > .type > input[name='grassland']").val( $(".more > .type > input[name='grassland'][type='range']").val()/sum );
		$(".more > .type > input[name='desert']").val( $(".more > .type > input[name='desert'][type='range']").val()/sum );
	}
	$(".more > .type > input[name='forest']:not([type='range'])").val( $(".more > .type > input[name='forest'][type='range']").val() );
	$(".more > .type > input[name='grassland']:not([type='range'])").val( $(".more > .type > input[name='grassland'][type='range']").val() );
	$(".more > .type > input[name='desert']:not([type='range'])").val( $(".more > .type > input[name='desert'][type='range']").val() );
});

//浏览器打开
$("a.newTable").click(function(){
	if (typeof plus == "undefined"){
		window.open( this.href );
	}else{
		plus.runtime.openURL( this.href );
	}
});

//打开页面
function open(url="main.html"){
	layer.load(0);
	console.log(url)
	location.href = url;
	
	return false;
}



//新的世界
$("#new_world")[0].onclick = function(){
	console.log("new_world", $(".init").css("display"), $(".new_world").css("display"), $("button").attr("disabled"));
	
	$("button").attr("disabled", "true");
	$(".init")
		.css("left", "0%")
		.css("opacity", "1")
		.animate({
			left: (Math.random(0,1,0)?"-":"") + "100%", //正负100%
			opacity: 0
		}, 1000, ()=>{
			$(".init").css("display", "none");
			$("button").removeAttr("disabled");
			console.log("new_world", "animate end", $(".init").css("display"), $(".new_world").css("display"), $("button").attr("disabled"));
		});
	$(".new_world")
		.css("top", (Math.random(0,1,0)?"-":"") + "100%") //正负100%
		.css("opacity", "0")
		.css("display", "block")
		.animate({
			top: "0%",
			opacity: 1
		}, 1000);
	$(".more").removeAttr("open");
	
	console.log("new_world", "animate start", $(".init").css("display"), $(".new_world").css("display"), $("button").attr("disabled"));
};

//新的世界 取消
$(".new_world button.back").click(function(){
	console.log("init", $(".init").css("display"), $(".new_world").css("display"), $("button").attr("disabled"));
	
	$("button").attr("disabled", "true");
	$(".init")
		.css("left", (Math.random(0,1,0)?"-":"") + "100%") //正负100%
		.css("opacity", "0")
		.css("display", "flex")
		.animate({
			left: "0%",
			opacity: 1
		}, 1000);
	$(".new_world")
		.css("top", "0%")
		.css("opacity", "1")
		.animate({
			top: (Math.random(0,1,0)?"-":"") + "100%", //正负100%
			opacity: 0
		}, 1000, ()=>{
			$(".new_world").css("display", "none");
			$("button").removeAttr("disabled");
			console.log("init", "animate end", $(".init").css("display"), $(".new_world").css("display"), $("button").attr("disabled"));
		});
	$(".more").removeAttr("open");
	
	console.log("init", "animate start", $(".init").css("display"), $(".new_world").css("display"), $("button").attr("disabled"));
});


//关于
$("#about").click(function(){
	console.log("about", $(".init").css("display"), $(".about").css("display"), $("button").attr("disabled"));
	
	$("button").attr("disabled", "true");
	$(".init")
		.css("left", "0%")
		.css("opacity", "1")
		.animate({
			left: (Math.random(0,1,0)?"-":"") + "100%", //正负100%
			opacity: 0
		}, 1000, ()=>{
			$(".init").css("display", "none");
			$("button").removeAttr("disabled");
			console.log("about", "animate end", $(".init").css("display"), $(".about").css("display"), $("button").attr("disabled"));
		});
	$(".about")
		.css("top", (Math.random(0,1,0)?"-":"") + "100%") //正负100%
		.css("opacity", "0")
		.css("display", "block")
		.animate({
			top: "0%",
			opacity: 1
		}, 1000);
	
	console.log("about", "animate start", $(".init").css("display"), $(".about").css("display"), $("button").attr("disabled"));
	
	/*try{
		plus.screen.lockOrientation("portrait-primary");
	}catch(err){}
	// window.open("https://wzh656.github.io/MinecraftWeb/", "newwin", "height=366, width=666, toolbar=no, menubar=no, location=no");
	open("https://wzh656.github.io/MinecraftWeb/")*/
});

//关于 取消
$(".about button.back").click(function(){
	console.log("init", $(".init").css("display"), $(".about").css("display"), $("button").attr("disabled"));
	
	$("button").attr("disabled", "true");
	$(".init")
		.css("left", (Math.random(0,1,0)?"-":"") + "100%") //正负100%
		.css("opacity", "0")
		.css("display", "flex")
		.animate({
			left: "0%",
			opacity: 1
		}, 1000);
	$(".about")
		.css("top", "0%")
		.css("opacity", "1")
		.animate({
			top: (Math.random(0,1,0)?"-":"") + "100%", //正负100%
			opacity: 0
		}, 1000, ()=>{
			$(".about").css("display", "none");
			$("button").removeAttr("disabled");
			console.log("init", "animate end", $(".init").css("display"), $(".about").css("display"), $("button").attr("disabled"));
		});
	$(".more").removeAttr("open");
	
	console.log("init", "animate start", $(".init").css("display"), $(".about").css("display"), $("button").attr("disabled"));
});


//社区
$("#community").click(function(){
	open("community.html");
});



//已有存档
if (localStorage.getItem("我的世界_seed") !== null){
	$("#new_world")[0].innerHTML = "开始游戏<small>PLAY</small>"
	$("#new_world")[0].onclick = ()=>open();
}else{ //无存档
	// getGeolocationPosition();
}


//生成世界
$(".new_world > button:eq(1)").click(function(){
	const time = +inputValueToDate( $(".more > .time-position > input[name='time']").val() )
		position = {
			latitude: +$(".more > .time-position > input[name='latitude']").val(),
			longitude: +$(".more > .time-position > input[name='longitude']").val()
		},
		height = {
			min: +$(".more > .height > [name='min']").val(),
			max: +$(".more > .height > [name='max']").val(),
			q: +$(".more > .height > [name='q']").val(),
			error:{
				min: +$(".more > .height > .error > [name='min']").val(),
				max: +$(".more > .height > .error > [name='max']").val(),
				q: +$(".more > .height > .error > [name='q']").val()
			}
		},
		dirt = {
			min: +$(".more > .dirt > [name='min']").val(),
			max: +$(".more > .dirt > [name='max']").val(),
			q: +$(".more > .dirt > [name='q']").val(),
			error:{
				min: +$(".more > .dirt > .error > [name='min']").val(),
				max: +$(".more > .dirt > .error > [name='max']").val(),
				q: +$(".more > .dirt > .error > [name='q']").val()
			}
		},
		type = {
			foreset: +$(".more > .type > [name='foreset']").val(),
			grassland: +$(".more > .type > [name='grassland']").val(),
			desert: +$(".more > .type > [name='desert']").val(),
			q: +$(".more > .type > [name='q']").val()
		},
		treeHeight = {
			plant:{
				min: +$(".more > .treeHeight > .plant > [name='min']").val(),
				max: +$(".more > .treeHeight > .plant > [name='max']").val()
			},
			min: +$(".more > .treeHeight > [name='min']").val(),
			max: +$(".more > .treeHeight > [name='max']").val(),
			q: +$(".more > .treeHeight > [name='q']").val(),
			error:{
				min: +$(".more > .treeHeight > .error > [name='min']").val(),
				max: +$(".more > .treeHeight > .error > [name='max']").val(),
				q: +$(".more > .treeHeight > .error > [name='q']").val()
			}
		},
		leavesScale = {
			min: +$(".more > .leavesScale > [name='min']").val(),
			max: +$(".more > .leavesScale > [name='max']").val(),
			q: +$(".more > .leavesScale > [name='q']").val(),
			error:{
				min: +$(".more > .leavesScale > .error > [name='min']").val(),
				max: +$(".more > .leavesScale > .error > [name='max']").val(),
				q: +$(".more > .leavesScale > .error > [name='q']").val()
			}
		},
		openStone = {
			min: +$(".more > .openStone > [name='min']").val(),
			max: +$(".more > .openStone > [name='max']").val(),
			q: +$(".more > .openStone > [name='q']").val()
		},
		weatherRain = {
			min: +$(".more > .weatherRain > [name='min']").val(),
			max: +$(".more > .weatherRain > [name='max']").val(),
			q: +$(".more > .weatherRain > [name='q']").val(),
			error:{
				min: +$(".more > .weatherRain > .error > [name='min']").val(),
				max: +$(".more > .weatherRain > .error > [name='max']").val(),
				q: +$(".more > .weatherRain > .error > [name='q']").val()
			}
		};
	let seed;
	if ($("[name='seed']").val() === ""){ //随机种子
		seed = Math.random().toString(36).substring(2);
	}else{
		seed = $("[name='seed']").val();
	}
	localStorage.setItem("我的世界_seed", seed);
	localStorage.setItem("我的世界_time", time);
	localStorage.setItem("我的世界_position", JSON.stringify(position));
	localStorage.setItem("我的世界_height", JSON.stringify(height));
	localStorage.setItem("我的世界_dirt", JSON.stringify(dirt));
	localStorage.setItem("我的世界_type", JSON.stringify(type));
	localStorage.setItem("我的世界_treeHeight", JSON.stringify(treeHeight));
	localStorage.setItem("我的世界_leavesScale", JSON.stringify(leavesScale));
	localStorage.setItem("我的世界_openStone", JSON.stringify(openStone));
	localStorage.setItem("我的世界_weatherRain", JSON.stringify(weatherRain));
	
	open();
});

//双击
$("h1").on("dblclick",function(){
	for (let i=0; i<36*Math.random()+36; i++){
		$(".init").animate({
			left: (Math.random()*6-3)+"%",
			top: (Math.random()*6-3)+"%",
			opacity: 1
		},10);
	}
	$(".init").animate({
		left: "0%",
		top: "0%",
		opacity: 1
	},10);
});
$("h2").on("dblclick",function(){
	for (let i=0; i<36*Math.random()+36; i++){
		$(".new_world").animate({
			left: (Math.random()*6-3)+"%",
			top: (Math.random()*6-3)+"%",
			opacity: 1
		},10);
	}
	$(".new_world").animate({
		left: "0%",
		top: "0%",
		opacity: 1
	},10);
});

//防止滑动
/*$("*").attr("tabindex","-1");
setInterval(function(){
	window.scrollTo(0, 0);
},0);
document.onkeydown = function(e){
	if (e.keyCode == 9){ //Tab
		if (e.preventDefault){
			e.preventDefault();
		}else{
			e.returnValue = false;
		}
	}
}*/
</script>
	</body>
</html>
